package com.d.lib.ui.view.sort;

import java.util.Comparator;
import ohos.agp.utils.TextTool;

/**
 * PinyinComparator
 * Created by D on 2017/6/7.
 */
public class PinyinComparator implements Comparator<SortBean> {
  @Override
  public int compare(SortBean o1, SortBean o2) {
    if (TextTool.isEqual(o1.letter, "#")) {
      return 1;
    } else if (TextTool.isEqual(o2.letter, "#")) {
      return -1;
    } else {
      return o1.pinyin.compareTo(o2.pinyin);
    }
  }
}
